﻿using System;
using Windows.UI.Xaml.Data;

namespace PPCalc.Converters
{
    public class DecimalConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            return value.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            decimal result;
            decimal.TryParse(value as string, out result);
            return result;
        }
    }
}
